
function addformvdoupload(config)
{


    $("#addform").append('<div id="feature'+rowdiv+'" class="itPlg addVdoUlPlg featureclass">'+dataform['vdoupload']+"</div>");
    var rownow=rowdiv;
    var sizelimit=0;
    if(NameDmconnex=='9ENTERTAIN')
    {
    sizelimit=10485760;
    
    }
    
  //console.log('#feature'+rownow+'  .linkvdobutton');
  $('#feature'+rownow+'  .linkvdobutton').iuploader({
         'link':serviceinfo+'iuploadfile',
         'accept':config.accept,
         'group':rownow,
         'type':config.allow,
         'sizelimit':sizelimit,
         'onStartUpload':function(setting){
       //  $('#feature'+rownow+' .ico2.icoCrtGrn').hide();
    //     $('#feature'+rownow+' .btnIco.upAddIco').hide();
         
         var bytename=bytesToSize(setting['size'],2);
         $('#feature'+rownow+' .desPlg.clTxt3.fs03').html(bytename);
        // $('#feature'+rownow+' .fileName').html(setting['fileold']);
         },
         'load':$('#feature'+rownow+' .desPlg.clTxt3.fs03'),
         'finish':$('#feature'+rownow+' .ico2.icoCrtGrn'),
         'isimg':false,
         'onUploadFinish':function(filename,filelink,setting){
         
          $("#fileid-"+setting.id).val(setting.fileid);
          $("#fileold-"+setting.id).val(setting.fileold);
         
         // $('#feature'+rownow+' .fileName').html('<a href="'+filelink+'" target="'+filelink+'">'+setting.fileold+'</a>');
        $('#feature'+rownow+' .plgArea').html(' <video width="100%" height="360" controls><source src="'+filelink+'" type="video/mp4"></video>');
         
         

         //alert(filename);
         }
   });
   $('#feature'+rownow+' .deletevdobutton').click(function() {

   $('#feature'+rownow+' input[name="fileold[]"]').val('');
   $('#feature'+rownow+' input[name="fileid[]"]').val('');
   $('#feature'+rownow+' input[name="filelink[]"]').val('');
   $('#feature'+rownow+' .plgArea').html('');
   $('#feature'+rownow+' .desPlg.clTxt3.fs03').html('Explain more about your stuff by add some vdo clip for it');
   
   });
   
   $('#feature'+rownow+' .deleterowbutton').click(function(){
   
    $('#feature'+rownow).remove();
    
   });
   
   

    
    
    
    
    rowdiv++;

}

function saveformvdoupload(id,plugid)
{
var obj={};
if($("#"+id+' input[name="fileid[]"]').val()!="")
{
obj={plugid:plugid,fileid:$("#"+id+' input[name="fileid[]"]').val()};
}

return obj;

}
function getformvdoupload(dataplugin)
{
var code="";
if(dataplugin.file.filename)
{
code +='<div class="wrpVdoLdcheckrow" id="uploadvdoid2-'+dataplugin['uploadid']+'">\n';
code += '<div class="ldIt wrpVdoLd clBg4 w640 " id="uploadvdoid-'+dataplugin['uploadid']+'">\n';

code+='<video width="100%" height="360" id="uploadvdoidsetscript-'+dataplugin['uploadid']+'" src="'+dataplugin.file.newpath+'" controls><source src="'+dataplugin.file.newpath+'" type="video/mp4"></video>';


code += '</div>';
code += '</div>';

}


return code;

}
function editformvdoupload(config,datarow)
{
    if(datarow.fileid!="0")
    {
     addformvdoupload(config);
     var rownow= rowdiv-1;
      
       $('#feature'+rownow+' input[name="fileid[]"]').val(datarow.fileid);
       $('#feature'+rownow+' .plgArea').html(' <video width="100%" height="360" controls><source src="'+datarow.file.newpath+'" type="video/mp4"></video>');


    }
       
}
